"""
放置项目相关资源的模块,包括按键的文字，加密的答案和游戏的谜语，提示
信息等。
"""

import hashlib as hb
import random as rm

# 创建一个字典存储按键字符
dict_key = {"1": "九一大底走闻鸡一花生篇流观起交捞有织舞下容马爱千死恨无乃律耻月海",
            "2": "容之待捞走流山花观大鸡击下卵以生爱因织舞上失以交逼双千小闻管石梁",
            "3": "乃管观织千起马舞鸡鲍闻捞交律无下走死流交花底生九恨容一海大之月爱",
            "4": "容爱交底管下恨之织月观舞鸡马走流捞乃律齐大无千双起生一海九闻交花",
            "5": "双之花恨下千海以舞爱生底齐无月坐乃一织捞鸡走闻毙流容交管交九观待",
            "6": "观双坐宜之织底九地齐流管生爱一乃制闻恨花舞因待以无千下鸡交捞走容",
            "7": "流因花织石一千待制鸟生管底观容九宜以双一鸡舞地捞之下闻二爱走坐交",
            "8": "一走舞织以失闻小石流双一花坐大爱二因九生鸡管观交鸟之待捞千下底容",
            "9": "容一捞闻管大卵交以舞花以双下小待石流鸡走坐因底之观生九织击失千爱",
            "10": "地待千下底鸡走宜流操急恨织因观乃交过坐双容之制捞花无之九以舞齐闻",
            "11": "音流观底恨交海织鸡乃静生舞大佳一月起千候容花爱交管闻马之九律捞鲍",
            "12": "底容流闻二静舞走地双动以花之交宜织坐观管鸟一九鸡石以生爱因制捞下",
            "13": "律起舞莫恨鞭捞及织观闻急有鸡走耻月花流乃无下篇海马千生容交长爱死",
            "14": "管卵九击鸡闻实花双以交底坐邦流走爱大舞兴千容以一生失织捞观因之干",
            "15": "生一击花底管鸡千久交日双走容以情生闻流失以因舞爱九之织坐大卵观捞",
            "16": "情卵以走乃鸡日爱闻气失因粗财千捞坐管花一生舞双大因交底流久容织击",
            "17": "花失鸡走以击容生测双财深久舞坐日闻因底爱气捞可大不织一粗情以千流",
            "18": "花可大鸡不舞测走气爱闻如财双织深击流因日千度失底坐以以容年捞粗一",
            "19": "大气里捞失日双击鸡以花走因可深财粗底不测情千一爱闻容一以舞织坐流",
            "20": "律阴闻光九花交观大起似千乃恨管流鸡月容交底舞之鲍箭海马一织爱捞生",
            "21": "穷乃恨月容似恶爱生舞阴花管海大凶流之交织观光马底九箭极千一交起律",
            "22": "九箭海生交大乃织爱花千乳律马底观月水交似阴容流一光之舞管起融死恨",
            "23": "马舞月律千流乃观死管作上箭似阴底水生爱织乳壁之观交融光花交大起九",
            "24": "壁月底观花闻观乃爱之起愿管交箭作其马阴大流光织上律舞死千详似生九",
            "25": "方交壁长九底花管详律来闻观织月马起死其日流千作愿爱之大乃舞观生上",
            "26": "律流爱长千大方之来起山作其壁日水管详马月愿织观乃交死舞色观光上闻",
            "27": "之作爱死马血针长来详织律流方愿壁舞上观千交观管见一大乃日月闻其起",
            "28": "生以失底捞观管容餐花流恨千织久日鸡击一卵舞九坐情之三因大生以爱闻",
            "29": "恶舞涌久花卵之管因日千坐涛观九汹大底一击以捞三餐生波鸡爱以织容乃",
            "30": "管恶交流千没爱生极容恨织日箭海交大没起似阴花月夜律舞凶之九一穷乃"
            }

# 创建一个答案存储的字典
dict_result = {"1": "42e37538503f09bb2629d26f49ecb32c",
               "2": "5e47ab8609bf63da8a942f4ceb96af6c",
               "3": "ebe6181a66cf00a9c79b529a48c9098a",
               "4": "b14102f4823a97a05b5a72fee5debf79",
               "5": "944ec5c36a7f9f39600eb85b3a46a8d2",
               "6": "34618c8a55beb0d6b8859c0c77b00981",
               "7": "af3a536fb95749b5fd5817beddddedcb",
               "8": "ad88d25f1f4ac3fa58775ff7a3d70382",
               "9": "440f0b05fbe3609f4095a132b59c3bfc",
               "10": "ea456b9b9485009da498dec1a73d5fe7",
               "11": "969e9031f56b6b67ed3c854dcb7f0612",
               "12": "53811c2317228899ba7a1fc724aab73d",
               "13": "288fe2ac719724f07ab57e6c260106a9",
               "14": "647d28267145a7206d9bca2c6d6308ce",
               "15": "c8be4e881efd9e4205fa86fc9a888017",
               "16": "ea2acf1a23bbbe385c6d95da39e10bfc",
               "17": "4c68e5ba1f043c2713e81aca3dc16c5e",
               "18": "f2bc8608008cad7ffc842f2dad647358",
               "19": "37fc39fca0b255653649ea7a1be9b02c",
               "20": "f9ce1fb71adf0c620e7fc295c58384e8",
               "21": "74b5e80642c3d9397ffebd03ebfaf038",
               "22": "fcb9f14e613a2b98a7ba33aeeecbccf2",
               "23": "b3c905b20c545bf1b928972aad537dc3",
               "24": "6224a26d19ade89885e2d73c644d26e4",
               "25": "75f4fb46146707576b6a0f38719d7aa1",
               "26": "314cf79a06abb1643bc4298bc7d923bc",
               "27": "6dcd8d4a2201f82358585c38440d039d",
               "28": "fa40d7d694f465940bea9a338d12b5ef",
               "29": "5ddcf4676d0ef8fb7c444b4bd701470c",
               "30": "61999dc0e23ff0820ae4a3150d4e7229",
               }

# 创建关卡问题字典
dict_problems = {"1": "1.为什么男人公认择天记中徐有容的身材最好？",
                 "2": "2.女子不穿衣服去爬山？",
                 "3": "3.为什么后人很质疑春秋时期管仲和鲍叔牙的关系？",
                 "4": "4.两只白手臂放在一只黑手臂上？",
                 "5": "5.男子脱光衣服坐在床上等待妻子？",
                 "6": "6.昭君出塞有什么重大的意义？",
                 "7": "7.两个男子不穿衣服坐在一块大石头上？",
                 "8": "8.女子不穿衣服坐在一块大石头上？",
                 "9": "9.男子洗澡时不小心仰面摔倒在地上？",
                 "10": "10.怎么看待男女不脱衣服就直入主题的现象？",
                 "11": "11.男人万花丛中过，保持处男身的最好理由？",
                 "12": "12.女人动，男人不动；女人不动，男人还是不动？",
                 "13": "13.情侣躺在床上相隔不到半米，男人为什么相当无奈？",
                 "14": "14.为什么说男女嘿嘿嘿可以促进国家经济的发展？",
                 "15": "15.有人赞同先同居后恋爱的依据是什么？",
                 "16": "16.怎么形容一个男人既钱多性功能又强？",
                 "17": "17.为什么男人面对腰长的女人会自卑？",
                 "18": "18.男人的性功能下降得厉害会怎么样？",
                 "19": "19.在飞机上嘿嘿嘿？",
                 "20": "20.为什么会流传女人白虎克夫的说法？",
                 "21": "21.为什么说胸小的女人很可怕？",
                 "22": "22.美女在洗澡？",
                 "23": "23.一边嘿嘿嘿，一边看书？",
                 "24": "24.有人特别喜欢干掏粪的工作，为什么？",
                 "25": "25.妓院门口让男人不能拒绝的广告词？",
                 "26": "26.水中倒影出没有一棵树的山峰？",
                 "27": "27.处女在新婚之夜会发生什么？",
                 "28": "28.爱情可以当饭吃的原因是什么？",
                 "29": "29.为什么说女人的咪咪是水做的？",
                 "30": "30.为什么说当人类不再繁殖，世界就永远不会陷入黑暗？"
                 }

# 创建答案提示列表
list_answer = ["", "有", "逼", "管", "双", "坐", "因", "一", "因", "以",
               "操", "静", "以", "鞭", "实", "日", "财", "深", "度", "一",
               "光", "穷", "水", "作", "愿", "来", "山", "一", "一", "波", "没"]


class AllButton(object):
    """创建一个开关类管理所有的开关便于以后的扩展"""

    def __init__(self):
        self.the_answer = False  # 设置答案是否正确的开关
        self.cls_answer = False  # 设置清空答案的开关
        self.start_game = False  # 进入游戏的开关


abt = AllButton()

if __name__ == "__main__":
    print(len(dict_key))
    str1 = ""  # 用来生成加密的答案
    md5_answer = hb.md5(str1.encode("utf-8")).hexdigest()
    print(md5_answer)  # 得到加密的答案
    str2 = ""
    results = rm.sample(str2, len(str2))
    results = "".join(results)
    print(results)  # 得到乱序后的字列

